$InstanceName = $args[0]

if (!$InstanceName)
{
    $InstanceName = "SQLEXPRESS"
}

$SsrsInstanceIdsRegPath = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\RS"
$SsrsInstanceIdsRegKey = Get-ItemProperty $SsrsInstanceIdsRegPath -ErrorAction "SilentlyContinue"

$SsrsInstanceId = $SsrsInstanceIdsRegKey.$InstanceName 
if (!$SsrsInstanceId)
{
    $SsrsInstanceId = $SsrsInstanceIdsRegKey.MSSQLSERVER
}

$SsrsInstanceInstallationRegPath = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\" + $SsrsInstanceId + "\Setup"
$SsrsInstanceInstallationRegKey = Get-ItemProperty $SsrsInstanceInstallationRegPath

$SsrsInstanceInstallationDir = $SsrsInstanceInstallationRegKey.SQLPath

$dest = $SsrsInstanceInstallationDir + "ReportServer\Styles\"
$file = "ssrs\ssrsreport.css"

Copy-Item $file $dest